@import './theme/default.less';

.ellipsis {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.zent-upload {
  &.inline {
    display: inline;
  }

  .zent-dialog-r {
    min-width: 760px !important;

    &-footer {
      margin-top: 0;
      padding-top: 10px;
      text-align: center;
    }

    &-title {
      margin-bottom: 10px;
    }
  }

  &-dialog {
    &.zent-dialog-r {
      padding: 15px;
    }
  }

  &__footer {
    text-align: center;
  }
}

.zent-upload-container {
  position: relative;
  padding: 0;
  overflow-y: auto;

  ul,
  li {
    list-style: none;
    margin: 0;
    padding: 0;
  }
}

.zent-upload-container {
  width: 760px;
  height: 480px;
  display: flex;
  flex-direction: column;
}

.zent-upload-network-image-region,
.zent-upload-group-region,
.zent-upload-local-attachment-region {
  padding: 30px 10px;
  overflow: hidden;

  .zent-upload-title {
    float: left;
    font-size: 14px;
    font-weight: bold;
    text-align: right;
    width: 100px;
  }

  .zent-upload-content {
    background-color: @theme-stroke-10;
    position: relative;
    zoom: 1;
    margin-left: 100px;
  }
}

.zent-upload-group-region {
  .zent-upload-title {
    line-height: 30px;
  }
}

.zent-upload-network-image-region {
  overflow: hidden;

  .zent-upload-content {
    display: flex;
  }

  .zent-btn {
    float: right;
  }

  .zent-upload-title {
    line-height: 30px;
  }

  .zent-upload-input-append {
    margin-bottom: 10px;
    margin-right: 10px;
    flex: 1;
  }

  .zent-upload-image-preview {
    max-width: 200px;
    max-height: 200px;

    img {
      max-width: 200px;
      max-height: 200px;
    }
  }
}

.zent-upload-local-attachment-region {
  height: 100%;

  .zent-upload-content {
    margin-top: -10px;
    height: 100%;
  }

  .zent-upload-local-tips {
    clear: both;
    padding-top: 20px;
    font-size: 12px;
  }

  .zent-upload__upload-local-image-list {
    height: auto;
    padding-top: 10px;

    .zent-upload-image-item {
      position: relative;
      float: left;
      margin: 0 10px 10px 0;
      width: 80px;
      height: 80px;

      &:hover {
        .zent-upload__close-modal {
          display: block;
        }
      }

      &__box {
        width: 80px;
        height: 80px;
        background-size: cover;
        background-position: 50% 50%;
      }

      &__progress {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        background: @theme-mask-black-6;
        color: @theme-stroke-10;
        text-align: center;
        line-height: 80px;
        font-size: 14px;
      }
    }
  }

  .zent-upload__upload-local-voice-list {
    height: auto;

    &::after {
      content: ".";
      display: block;
      height: 0;
      clear: both;
      visibility: hidden;
    }

    .zent-upload-voice-item {
      position: relative;
      float: left;
      width: 300px;
      height: 60px;
      margin-right: 10px;
      margin-bottom: 10px;
      padding: 9px;
      border: 1px solid @theme-stroke-7;
      cursor: pointer;
      box-sizing: border-box;

      &:hover {
        .zent-upload__close-modal {
          display: block;
        }
      }

      &__icon {
        width: 40px;
        height: 40px;
        background: @theme-stroke-6;
        background-size: 40px 40px;
        background-image: url('https://b.yzcdn.cn/upload/image/play@2x.png');

        &.loading {
          background-image: url('https://b.yzcdn.cn/upload/image/loading@2x.gif');
        }

        &.playing {
          background-image: url('https://b.yzcdn.cn/upload/image/playing@2x.gif');
        }
      }

      &__name {
        position: absolute;
        width: 200px;
        height: 18px;
        line-height: 18px;
        top: 10px;
        left: 60px;

        .ellipsis;
      }

      &__createtime {
        position: absolute;
        bottom: 10px;
        left: 60px;
        line-height: 14px;
        color: @theme-stroke-4;
      }

      &__duration {
        position: absolute;
        top: 12px;
        right: 10px;
      }

      &__progress {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        background: @theme-mask-black-6;
        color: @theme-stroke-10;
        text-align: center;
        line-height: 60px;
        font-size: 14px;
      }

      &__size {
        position: absolute;
        top: 34px;
        right: 10px;
        color: @theme-stroke-4;
      }
    }
  }
}

.zent-upload__close-modal {
  display: none;
  position: absolute;
  z-index: 2;
  color: @theme-stroke-10;
  text-align: center;
  cursor: pointer;
  background: @theme-mask-black-3;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 16px;
  border-radius: 9px;

  &:hover {
    color: @theme-stroke-10;
    background: @theme-stroke-1;
  }
}

.zent-upload-add-local-attachment {
  position: relative;
  width: 44px;
  height: 20px;
  line-height: 20px;
  cursor: pointer;
  overflow: hidden;

  input {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    direction: rtl;
    font-size: 23px;
    opacity: 0;
    cursor: pointer;
  }
}

.zent-upload-wrapper,
.zent-upload-add-local-image-button,
.zent-upload-trigger {
  position: relative;

  input[type=file] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    direction: rtl;
    font-size: 23px;
    opacity: 0;
    cursor: pointer;
  }
}

.zent-upload-add-local-image-button,
.zent-upload-trigger {
  display: inline-block;
  width: 80px;
  height: 80px;
  border: 2px dashed @theme-stroke-7;
  line-height: 71px;
  box-sizing: border-box;
  text-align: center;
  font-size: 36px;
  color: @theme-stroke-7;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
}

.zent-upload-add-local-image-button {
  margin: 0 20px 20px 0;
}

.zent-upload-tips {
  line-height: 14px;
  font-size: 12px;
  margin-top: 6px;
  margin-bottom: 0;
  color: @theme-stroke-3;
  position: absolute;
}

.zent-upload-link {
  color: @theme-primary-2;
  cursor: pointer;
  font-weight: bold;
}

.zent-upload-split {
  margin: 0 10px;
}
